//
//  HHIndicatorKey.m
//  FCHealthy
//
//  Created by mouxiaochun on 16/3/10.
//  Copyright © 2016年 mmc. All rights reserved.
//

#import "HHIndicatorKey.h"
 

@implementation HHIndicator

 


- (NSString *)year {
    return @"2016年";
}

- (NSString *)month {
    return @"12月";
}

 

//- (NSString *)indicatorValue {
//    
//    CGFloat value = [_indicatorValue floatValue];
//    NSString *iValue = [NSString stringWithFormat:@"%.0f",value];
//    return iValue;
//}

- (NSString *)day {
    return @"";
}
@end

@implementation HHIndicatorKey

+(NSDictionary *)configObject{
    return @{@"targetList":@"HHIndicator"};

}
- (NSString *)date {
    
    if (_datetime.length == 0) {
        NSString *current = [self currentDate];
        return current;
    }
     return _datetime;
}

- (NSString *)currentDate {
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy年MM月"];
    NSString *strDate = [dateFormatter stringFromDate:[NSDate date]];
    return strDate;
}

//带数值和单位
- (NSString *)value {

    HHIndicator *indicator = _indicators[0];
    return [NSString stringWithFormat:@"%@%@",indicator.indicatorValue,indicator.indicatorUnit];
}


- (NSString *)title {

    return [NSString stringWithFormat:@"您的%@：%@",_indicatorName,self.value];
}

- (NSString *)keyword {
    if (_keyword.length == 0) {
        HHIndicator *indicator = _indicators[0];
        _keyword = indicator.indicatorCode;
    }
    return _keyword;
}

- (NSString *)indicatorUnit {
    if (_indicatorUnit.length == 0) {
        _indicatorUnit = @"mmHg";
    }
    return _indicatorUnit;
}
@end
